package com.jly.entity;

import cn.hutool.core.annotation.Alias;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

//@Data
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@ToString
@TableName("`sys_user`")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Alias("用户名") // 此注解表示excle表头可以为中文
    @ApiModelProperty("用户名")
    private String username;

    @Alias("密码")
    @ApiModelProperty("密码")
    @JsonIgnore
    private String password;

    @Alias("昵称")
    @ApiModelProperty("昵称")
    private String nickname;

    @Alias("邮箱")
    @ApiModelProperty("邮箱")
    private String email;

    @Alias("电话")
    @ApiModelProperty("电话")
    private String phone;

    @Alias("地址")
    @ApiModelProperty("地址")
    private String address;

    @ApiModelProperty("创建时间")
    private Date createTime;

//    @Alias("头像")
    @ApiModelProperty("头像")
    private String avatarUrl;

    @ApiModelProperty("角色")
    private String role;

    @TableField(exist = false)
    private List<Course> courses;

    @TableField(exist = false)
    private List<Course> stuCourses;



/*    @TableField(exist = false)
    private List<Course> courses;

    @TableField(exist = false)
    private List<Course> stuCourses;*/


/*    @TableId(type = IdType.AUTO)
    private  Integer id;
    private String username;
//    @JsonIgnore(access= JsonProperty.Access.WRITE_ONLY)
    @JsonProperty(access= JsonProperty.Access.WRITE_ONLY)// 忽略密码不展示给前端
    @TableField("password")
    private  String password;
    private  Double money;
    private String address;
    private String head;*/






}
